package com.javaAdmin.controller;


import com.javaAdmin.model.Student;
import com.javaAdmin.server.RestfulStudentServer;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/cache")
public class CacheController {

    @Resource
    private RestfulStudentServer restfulStudentServer;

    @GetMapping("/info/{id}")
    public Student info(@PathVariable String id) {
        return restfulStudentServer.getInfoById(Integer.valueOf(id));
    }
}
